//
//  HJVersionListCell.m
//  KaiChat
//
//  Created by lx on 2023/10/19.
//

#import "HJVersionListCell.h"

@interface HJVersionListCell()

@property (nonatomic, weak) UIView *lineView;
@property (nonatomic, weak) UIImageView *arrowImageView;
@property (nonatomic, weak) UILabel *titleLabel;
@property (nonatomic, weak) UILabel *subTitleLabel;


@end


@implementation HJVersionListCell


- (void)settingSubView {
 
    self.backgroundColor = UIColor.whiteColor;
    
    _titleLabel = [UILabel lableWithSuperView:self.contentView font:UIFontMake(14) color:UIColor.tj_333333Color title:nil textAlignment:NSTextAlignmentLeft];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(leftRightMargin);
        make.top.inset(16);
    }];
    
    _subTitleLabel = [UILabel lableWithSuperView:self.contentView font:UIFontMake(14) color:UIColor.tj_BEBDCAColor title:nil textAlignment:NSTextAlignmentLeft];
    [_subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_titleLabel);
        make.top.equalTo(_titleLabel.mas_bottom).offset(4);
    }];
    
    _arrowImageView = [UIImageView addToView:self.contentView];
    _arrowImageView.image = [UIImage imageNamed:@"cell_arrow"];
    [_arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.inset(leftRightMargin);
        make.centerY.offset(0);
    }];
}

- (void)setDict:(NSDictionary *)dict {
    _dict = dict;
    
    _titleLabel.text = dict[@"title"];
    _subTitleLabel.text = [[NSDate dateWithTimeIntervalSince1970:[dict[@"published_at"] integerValue]] stringWithFormat:@"dd MMM yyyy HH:mm"];
}

 
@end
